import pika

# following is steps of example of named queue(https://www.rabbitmq.com/tutorials/tutorial-one-python.html):
# make credentials
# create connection
# get channel
# declare queue
# publish message through exchange

auth = pika.PlainCredentials('test', 'test')
connection = pika.BlockingConnection(
    pika.ConnectionParameters('hadoop888', credentials=auth))
channel = connection.channel()
channel.queue_declare(queue='hello')
channel.basic_publish(exchange='',
                      routing_key='hello',
                      body='Hello World!')
print(" [x] Sent 'Hello World!'")
connection.close()
